﻿package net.wangit.dev.wizard.unit;

import net.wangit.dev.wizard.ComponentUtil;
import net.wangit.jdbc.ColumnRow;
import net.wangit.jdbc.DB;
import net.wangit.jdbc.Table;

public class AUnitGroup {

	public AUnitGroup() {
	}

	public static final void create(DB db, String groupId, String groupName)
			throws Exception {
		if (ComponentUtil.existentUnitGroup(db, groupId)) {
			return;
		} else {
			Table table = new Table("dev", "CGROUP");
			ColumnRow row = table.addInsertRow();
			row.set("t", 2);
			row.set("gid", groupId);
			row.set("n", groupName);
			db.save(table);
			return;
		}
	}
}
